#include "cet/ansi_x3_4_1968.h"
#include "cet/cp1252.h"
-/* %%% short hand strings transmission for main character sets %%% */
-char*
-cet_str_utf8_to_cp1252(const char* src)
-{
- return cet_str_utf8_to_any(src, &cet_cs_vec_cp1252);
-}
-char*
-cet_str_cp1252_to_utf8(const char* src)
-{
- return cet_str_any_to_utf8(src, &cet_cs_vec_cp1252);
-}
+/* %%% short hand strings transmission for main character sets %%% */
short*
cet_str_utf8_to_uni(const char* src, int* length)
return case_ignore_strcmp(va->name, vb->name);
}
-static signed int
-cet_cs_vec_qsort_cb(const void* a, const void* b)
-{
- const cet_cs_vec_t* va = *(cet_cs_vec_t**)a;
- const cet_cs_vec_t* vb = *(cet_cs_vec_t**)b;
- return case_ignore_strcmp(va->name, vb->name);
-}
-
void
cet_register_cs(cet_cs_vec_t* vec)
{
#ifdef cet_cs_name_ansi_x3_4_1968
cet_register_cs(&cet_cs_vec_ansi_x3_4_1968);
#endif
-#ifdef cet_cs_name_cp1250
- cet_register_cs(&cet_cs_vec_cp1250);
-#endif
#ifdef cet_cs_name_cp1252
cet_register_cs(&cet_cs_vec_cp1252);
#endif
-#ifdef cet_cs_name_cp1255
- cet_register_cs(&cet_cs_vec_cp1255);
-#endif
-#ifdef cet_cs_name_iso_8859_1
- cet_register_cs(&cet_cs_vec_iso_8859_1);
-#endif
-#ifdef cet_cs_name_iso_8859_15
- cet_register_cs(&cet_cs_vec_iso_8859_15);
-#endif
-#ifdef cet_cs_name_iso_8859_8
- cet_register_cs(&cet_cs_vec_iso_8859_8);
-#endif
if (cet_cs_vec_ct > 0) {
cet_cs_vec_t* p;
static char* date_time_format = NULL;
static int precision = 3;
static time_t utc_offs = 0;
+// Having a Windows background, this software encodes degree marks in
+// Windows CP-1252. We don't attempt to handle all the subtleties of that,
+// but since we write degree marks and we know how they're encoded, use this.
+static const int kDegreeSymbol = 0xB0;
static gtxt_flags_t gtxt_flags;
if ((A != NULL) && (B != NULL) && (A != B)) {
int course;
course = si_round(waypt_course(A, B));
- cet_gbfprintf(fout, &cet_cs_vec_cp1252, "%d%c true", course, 0xB0);
+ gbfprintf(fout, "%d%c true", course, kDegreeSymbol);
}
}
grid_str = xstrdup(gt_get_mps_grid_longname(grid_index, MYNAME));
while ((c = strchr(grid_str, '*'))) {
- *c = 0xB0; /* degree sign */
+ *c = kDegreeSymbol; /* degree sign */
}
- cet_gbfprintf(fout, &cet_cs_vec_cp1252, "Grid\t%s\r\n", grid_str);
+ gbfprintf(fout, "Grid\t%s\r\n", grid_str);
xfree(grid_str);
datum_str = gt_get_mps_datum_name(datum_index);